jade.content.abs
Class AbsAggregate

java.lang.Object
  |
  +--jade.content.abs.AbsObject
        |
        +--jade.content.abs.AbsTerm
              |
              +--jade.content.abs.AbsAggregate

public class AbsAggregate
extends AbsTerm

Author:
Federico Bergenti - Universita` di Parma
See Also:
Serialized Form

Constructor Summary
AbsAggregate(java.lang.String typeName)
          Constructor
 
Method Summary
 void add(AbsTerm element)
          Adds a new element.
 void clearAllElement()
          Clear the aggregate.
 boolean containsElement(AbsTerm element)
          Test if the aggregate contains an element.
protected  void dump(int indent)
           
 Iterator getAllElement()
          Retrieves all elements.
 Iterator getAllElements()
          Returns an iterator to all elements.
 AbsTerm getElement(int i)
          Retrieves the i-th element.
 int getElementCount()
          Retrieves the number of elements.
 int indexOfElement(AbsTerm element)
          Returns the position of an element.
 boolean isEmpty()
          Test if the aggregate is empty.
 boolean removeElement(AbsTerm element)
          Removes an element.
 AbsTerm removeElement(int index)
          Removes an element.
 AbsTerm[] toArray()
          Converts the aggregate to an array.
 
Methods inherited from class jade.content.abs.AbsObject
dump, getAbsObject, getCount, getNames, getTypeName, isGrounded, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsAggregate

public AbsAggregate(java.lang.String typeName)
Constructor
Parameters:
typeName - name of the type of the elements.
Method Detail

add

public void add(AbsTerm element)
Adds a new element.
Parameters:
element - the element to add.

getElementCount

public int getElementCount()
Retrieves the number of elements.
Returns:
the number of elements.

getElement

public AbsTerm getElement(int i)
Retrieves the i-th element.
Parameters:
i - index of the element to retrieve.
Returns:
the element.

getAllElement

public Iterator getAllElement()
Retrieves all elements.
Returns:
the elements.

getAllElements

public Iterator getAllElements()
Returns an iterator to all elements.
Returns:
the elements.

clearAllElement

public void clearAllElement()
Clear the aggregate.

containsElement

public boolean containsElement(AbsTerm element)
Test if the aggregate contains an element.
Returns:
the result of the test.

indexOfElement

public int indexOfElement(AbsTerm element)
Returns the position of an element.
Returns:
the position.

removeElement

public AbsTerm removeElement(int index)
Removes an element.
Returns:
the removed element.

removeElement

public boolean removeElement(AbsTerm element)
Removes an element.
Returns:
if the element has been removed.

isEmpty

public boolean isEmpty()
Test if the aggregate is empty.
Returns:
the result of the test.

toArray

public AbsTerm[] toArray()
Converts the aggregate to an array.
Returns:
the converted array.

dump

protected void dump(int indent)
Overrides:
dump in class AbsObject